home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 24 / AACD 24.iso / AACD / Sound / LAME / WarpOS / src / dshow / aboutprp.cpp next >
Encoding:
C/C++ Source or Header  |  2001-02-17  |  4.1 KB  |  187 lines

  1. //
  2. //  Copyright (c) 2000  ELECARD.  All Rights Reserved.
  3. //
  4. //
  5. // aboutprp.cpp - About LAME Encoder
  6. //
  7.  
  8. #include <windows.h>
  9. #include <streams.h>
  10. #include <olectl.h>
  11. #include <olectlid.h>
  12. #include <commctrl.h>
  13. #include "iaudioprops.h"
  14. #include "aboutprp.h"
  15. #include "mpegac.h"
  16. #include "resource.h"
  17. #include "Reg.h"
  18.  
  19.  
  20. // -------------------------------------------------------------------------
  21. // CMAEAbout
  22. // -------------------------------------------------------------------------
  23.  
  24.  
  25. CHAR lpszText[] = "This library is free software; you can redistribute it \r\n"                         
  26.                         "and/or modify it under the terms of the GNU \r\n" 
  27.                         "Library General Public License\r\n" 
  28.                         "as published by the Free Software Foundation;\r\n" 
  29.                         "either version 2 of the License,\r\n" 
  30.                         "or (at your option) any later version.\r\n" 
  31.                         "\r\n"
  32.                         "This library is distributed in the hope that it will be useful,\r\n" 
  33.                         "but WITHOUT ANY WARRANTY;\r\n" 
  34.                         "without even the implied warranty of MERCHANTABILITY or \r\n"  
  35.                         "FITNESS FOR A PARTICULAR PURPOSE. See the GNU \r\n"
  36.                         "Library General Public License for more details.\r\n"                    
  37.                         "\r\n"
  38.                         "You should have received a copy of the GNU\r\n"
  39.                         "Library General Public License\r\n"
  40.                         "along with this library; if not, write to the\r\n"
  41.                         "Free Software Foundation,\r\n"
  42.                         "Inc., 59 Temple Place - Suite 330,\r\n"
  43.                         "Boston, MA 02111-1307, USA.\r\n";
  44. /*
  45. This library is free software; you can redistribute it and/or
  46.  * modify it under the terms of the GNU Library General Public
  47.  * License as published by the Free Software Foundation; either
  48.  * version 2 of the License, or (at your option) any later version.
  49.  *
  50.  * This library is distributed in the hope that it will be useful,
  51.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  52.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.     See the GNU
  53.  * Library General Public License for more details.
  54.  *
  55.  * You should have received a copy of the GNU Library General Public
  56.  * License along with this library; if not, write to the
  57.  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  58.  * Boston, MA 02111-1307, USA.
  59. */
  60. //
  61. // CreateInstance
  62. //
  63. CUnknown * WINAPI CMAEAbout::CreateInstance(LPUNKNOWN lpunk, HRESULT *phr)
  64. {
  65.     CUnknown *punk = new CMAEAbout(lpunk, phr);
  66.     if (punk == NULL) {
  67.         *phr = E_OUTOFMEMORY;
  68.     }
  69.  
  70.     return punk;
  71. }
  72.  
  73.  
  74. //
  75. // Constructor
  76. //
  77. // Creaete a Property page object for the MPEG options
  78. CMAEAbout::CMAEAbout(LPUNKNOWN lpunk, HRESULT *phr)
  79.     : CBasePropertyPage(NAME("About LAME Ain't MP3 Encoder"), lpunk,
  80.         IDD_ABOUT,IDS_ABOUT)
  81.     , m_fWindowInActive(TRUE)
  82. {
  83.     ASSERT(phr);
  84.  
  85. //    InitCommonControls();
  86. }
  87.  
  88. //
  89. // OnConnect
  90. //
  91. // Give us the filter to communicate with
  92.  
  93. HRESULT CMAEAbout::OnConnect(IUnknown *pUnknown)
  94. {
  95.     return NOERROR;
  96. }
  97.  
  98.  
  99. //
  100. // OnDisconnect
  101. //
  102. // Release the interface
  103.  
  104. HRESULT CMAEAbout::OnDisconnect()
  105. {
  106.     // Release the interface
  107.  
  108.     return NOERROR;
  109. }
  110.  
  111.  
  112. //
  113. // OnActivate
  114. //
  115. // Called on dialog creation
  116.  
  117. HRESULT CMAEAbout::OnActivate(void)
  118. {
  119.  
  120.     // Add text to the window. 
  121.     m_fWindowInActive = FALSE;
  122.     SendDlgItemMessage(m_hwnd, IDC_EDIT_TEXT,  WM_SETTEXT, 0, (LPARAM) lpszText); 
  123. //    m_fWindowInActive = FALSE;
  124.     return NOERROR;
  125. }
  126.  
  127. //
  128. // OnDeactivate
  129. //
  130. // Called on dialog destruction
  131.  
  132. HRESULT CMAEAbout::OnDeactivate(void)
  133. {
  134.     m_fWindowInActive = TRUE;
  135.     return NOERROR;
  136. }
  137.  
  138.  
  139. //
  140. // OnApplyChanges
  141. //
  142. // User pressed the Apply button, remember the current settings
  143.  
  144. HRESULT CMAEAbout::OnApplyChanges(void)
  145. {
  146.     return NOERROR;
  147. }
  148.  
  149.  
  150. //
  151. // OnReceiveMessages
  152. //
  153. // Handles the messages for our property window
  154.  
  155. BOOL CMAEAbout::OnReceiveMessage( HWND hwnd
  156.                                 , UINT uMsg
  157.                                 , WPARAM wParam
  158.                                 , LPARAM lParam)
  159. {
  160.  
  161.     if(m_fWindowInActive)
  162.         return FALSE;
  163.  
  164.     switch (uMsg) {
  165.     case WM_DESTROY:
  166.         return TRUE;
  167.  
  168.     default:
  169.         return FALSE;
  170.  
  171.     }
  172.     return TRUE;
  173. }
  174.  
  175. //
  176. // SetDirty
  177. //
  178. // notifies the property page site of changes
  179.  
  180. void CMAEAbout::SetDirty()
  181. {
  182.     m_bDirty = TRUE;
  183.     if (m_pPageSite)
  184.         m_pPageSite->OnStatusChange(PROPPAGESTATUS_DIRTY);
  185. }
  186.  
  187.